package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.Receipt_Sales;
import com.gxa.service.SalesService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@Api(value = "销货或退货",tags = "销货或退货接口API")
@RequestMapping("/sales")
public class SalesController {
    @Autowired
    private SalesService SalesService;

    @RequestMapping(value = "/addSales",method = RequestMethod.POST)
    @ApiOperation(value = "添加销货或退货单接口",notes = "添加销货或退货单", response = R.class)
    @ResponseBody
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })

     public R addSales(@RequestBody @ApiParam(name = "receipt_Sales",value = "添加销货或退货单",required = true)Receipt_Sales receipt_Sales){
         return SalesService.inerstReceiptSales(receipt_Sales);

     }
    @RequestMapping(value = "/audit",method = RequestMethod.POST)
    @ApiOperation(value = "审核销货或退货单接口",notes = "审核销货或退货单", response = R.class)
    @ResponseBody
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
     public  R  audit(@RequestBody@ApiParam Map map){

        return  SalesService.auditReceiptSales(map);
     }




}
